package com.gufe.service.user.impl.mp;


import com.gufe.dto.FeedbackDTO.FeedbackDTO;
import com.gufe.entity.Feedback;
import com.gufe.mapper.user.mp.FeedbackMapper;
import com.gufe.service.user.mp.FeedbackService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class FeedbackServiceImpl implements FeedbackService {

    @Autowired
    private FeedbackMapper feedbackMapper;

    @Override
    public boolean submitFeedback(FeedbackDTO feedbackDTO, String userId) {
        Feedback feedback = new Feedback();
        BeanUtils.copyProperties(feedbackDTO,feedback);
        feedback.setUserId(userId); // 设置用户ID
        int result = feedbackMapper.insert(feedback);
        return result > 0;
    }
}